package BasicMethod;
public class ExcepTest {

    // public static void main(String args[]){
    // try{
    // int a[] = new int[2];
    // System.out.println("Access element three :" + a[2]);
    // }catch(ArrayIndexOutOfBoundsException e){
    // System.out.println("Exception thrown :" + e);
    // }
    // System.out.println("Out of the block");
    // }

    // public static void main(String[] args) {
    //     try {
    //         FileInputStream fileqqqq = new FileInputStream("qqq");
    //         fileqqqq.close();
    //         // byte x = (byte) fileqqqq.read();
    //     } catch (FileNotFoundException f) { // Not valid!
    //         f.printStackTrace();
    //         return;
    //     } catch (IOException i) {
    //         i.printStackTrace();
    //         return;
    //     }
    // }

    public static void main(String args[]){
        int a[] = new int[2];
        try{
           System.out.println("Access element three :" + a[3]);
        }catch(ArrayIndexOutOfBoundsException e){
           System.out.println("Exception thrown  :" + e);
        }
        finally{
           a[0] = 6;
           System.out.println("First element value: " +a[0]);
           System.out.println("The finally statement is executed");
        }
      }
}